import vnode from "./vnode";

export default function h(sel, data, params) {

  //字符串,无子元素
  if(typeof params == 'string' || typeof params == 'number') {
    return vnode(sel, data, undefined, params, undefined);
  } else if(Array.isArray(params)) {
    let children = [];
    for(let i = 0; i < params.length; i++) {
      children.push(params[i]);
    }
    return vnode(sel, data, children, undefined, undefined);
  }
}